import { REACT_TEXT } from './constants';

// 保证函数，将普通类型包装成type和props.content
export function wrapToVdom(element) {
    if (typeof element === 'string' || typeof element === 'number') {
        return {
            type: REACT_TEXT,
            props: {
                content: element
            }
        }
    } else {
        return element;
    }
}